package com.lb.statck.config;



import com.github.pagehelper.PageInterceptor;

import com.lb.statck.util.ListTypeHandler;
import org.mybatis.spring.boot.autoconfigure.ConfigurationCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.List;

@Configuration
public class MyBatisConfig {

    @Bean
    public ConfigurationCustomizer configurationCustomizer() {
        return configuration -> {
            configuration.getTypeHandlerRegistry().register(List.class, ListTypeHandler.class);
            configuration.addInterceptor(new PageInterceptor());
        };
    }
}